package com.batata.continuing.web.user;

import com.batata.continuing.config.moreNote.token.NotNeedToken;
import com.batata.continuing.pojo.base.ResultData;
import com.batata.continuing.service.user.UserLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(tags = "用户登陆接口")
@RestController
@RequestMapping("/user/login")
public class UserLoginController {

    @Autowired
    private UserLoginService loginService;


    /**
     * 登陆验证
     */
    @NotNeedToken
    @ApiOperation("登陆验证")
    @PostMapping("/verify")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "loginName", value = "登录名", required = true, dataType = "String"),
            @ApiImplicitParam(name = "loginPassword", value = "登陆密码", required = true, dataType = "String")
    })
    public ResultData<?> userLoginVerify(String loginName, String loginPassword) {
        return loginService.userLoginVerify(loginName, loginPassword);
    }

//    @NotNeedToken
//    @ApiOperation("getRedisTest")
//    @PostMapping("/getRedisTest")
//    public ResultData<Object> getRedisTest() {
//        return loginService.getRedisTest();
//    }
}
